import config from "@/config"
import http from "@/utils/request"


export default {
    list: {
        url: `${config.API_URL}/agent/list-page`,
        name: "获取列表",
        get: async function (params) {
            return await http.get(this.url, params);
        }
    },
    listByName: {
        url: `${config.API_URL}/agent/list-name`,
        name: "获取列表",
        get: async function (params) {
            return await http.get(this.url, params);
        }
    },
    action: {
        url: `${config.API_URL}/agent`,
        name: "用户操作",
        get: async function (params) {
            return await http.get(this.url, params);
        },
        post: async function (params) {
            return await http.post(this.url, params);
        },
        put: async function (params) {
            return await http.put(this.url, params);
        },
        delete: async function (params) {
            return await http.delete(this.url, params);
        }
    },
    updateStatus: {
        url: `${config.API_URL}/agent/status`,
        name: "状态变更",
        put: async function (params) {
            return await http.put(this.url, params);
        },
    },
    createShareQrcode: {
        url: `${config.API_URL}/agent/share-qrcode`,
        name: "生成分享二维码",
        post: async function (params) {
            return await http.post(this.url, params);
        },
    },
    audit: {
        list: {
            url: `${config.API_URL}/agent-audit/list-page`,
            name: "获取列表",
            get: async function (params) {
                return await http.get(this.url, params);
            }
        },
        action: {
            url: `${config.API_URL}/agent-audit`,
            name: "用户操作",
            get: async function (params) {
                return await http.get(this.url, params);
            },
            post: async function (params) {
                return await http.post(this.url, params);
            }
        },
        changeStatus: {
            url: `${config.API_URL}/agent-audit/status`,
            name: "状态审核",
            put: async function (params) {
                return await http.put(this.url, params);
            }
        }
    },
    category: {
        list: {
            url: `${config.API_URL}/agent-category/list-page`,
            name: "获取列表",
            get: async function (params) {
                return await http.get(this.url, params);
            }
        },
        all: {
            url: `${config.API_URL}/agent-category/all`,
            name: "获取所有",
            get: async function (params) {
                return await http.get(this.url, params);
            }
        }
    },
    level: {
        list: {
            url: `${config.API_URL}/agent-level/list-page`,
            name: "获取列表",
            get: async function (params) {
                return await http.get(this.url, params);
            }
        },
        all: {
            url: `${config.API_URL}/agent-level/all`,
            name: "获取所有",
            get: async function (params) {
                return await http.get(this.url, params);
            }
        }
    },
    teacher: {
        list: {
            url: `${config.API_URL}/agent-teacher/list-page`,
            name: "获取列表",
            get: async function (params) {
                return await http.get(this.url, params);
            }
        }
    }
}